﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Configuration.aspx.cs"
    Inherits="Fujitsu.JiraAnalysis.UI.Configuration" MasterPageFile="~/Site.Master" %>

<asp:Content runat="server" ContentPlaceHolderID="MainContent">
<script language="javascript">
    function confirmProjectDelete(message) {
        return confirm(message);
      }
</script>
    <div class="error">
        <asp:Literal runat="server" ID="errorNoProjects" Visible="false" Text="There are no projects configured" />
        <asp:Literal runat="server" ID="errorProjectDelete" Visible="false" Text="Project configuration deletion has failed. Please try again." />
    </div>
    <asp:ObjectDataSource runat="server" ID="ProjectsDataSource" 
        TypeName="Fujitsu.JiraAnalysis.DAL.ProjectStorage"
        SelectMethod="GetAllProjects" onselected="ProjectsDataSource_Selected" />
    <div class="center">
        <asp:GridView runat="server" ID="gridViewProjects" 
                    DataSourceID="ProjectsDataSource" DataKeyNames="ID" Height="100%" 
                    AllowPaging="true" PageSize="4" 
                    AutoGenerateColumns="false" Width="500"  
                    BorderStyle="None" BorderWidth="0" GridLines="Horizontal"
                    onrowdatabound="gridViewProjects_RowDataBound" 
            onrowcommand="gridViewProjects_RowCommand" >
            <HeaderStyle BackColor="#EEEEEE" HorizontalAlign="Left" Font-Size="16" />
            <RowStyle Font-Size="14" Height="35" BorderWidth="0" HorizontalAlign="Left" />            
            <Columns>
                <asp:TemplateField ItemStyle-Width="32">
                    <ItemTemplate>
                        <asp:HyperLink runat="server" NavigateUrl='<% #Eval("ID") %>'>
                            <asp:Image runat="server" ImageUrl="~/Images/desktop.png" BorderStyle="None" ToolTip="edit" />
                        </asp:HyperLink>                        
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:ImageButton runat="server" ID="btnDeleteProject" Text="remove" ImageUrl="~/Images/edit_delete.gif"
                            CommandName="deleteProject"
                            CommandArgument='<%# Eval("ID")%>' />
                    </ItemTemplate>
                </asp:TemplateField>   
                <asp:BoundField  DataField="Name" HeaderText="Project Name" ItemStyle-HorizontalAlign="Left" />        
                <asp:TemplateField HeaderText="Need validation" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:Image runat="server" ID="imageValidationNeeded" ImageUrl="~/Images/check.jpg" Visible='<%# Eval("IsNeedCheck") %>' Width="32"/>
                    </ItemTemplate>
                </asp:TemplateField>            
            </Columns>
        </asp:GridView>
    </div>
</asp:Content>
